═══ 1. RCOPY ═══ Dean R. Ammons v1.12 03/96 All Rights Reserved CompuServe: 73200,2513 Internet: FCI@MSG.TI.COM RCOPY is an extension of the OS/2 2.x COPY command. With the available options, a single RCOPY usage can perform tasks that would require several OS/2 commands. In addition to the parameter controlled functions, RCOPY will: * Displays progress messages. * If the selected filename already exists in the target directory, RCOPY will issue a warning pause, showing the size, time and date of the current and new file. * As a disk gets close to filling up, RCOPY will attempt to load the smaller files until the smallest file remaining will not fit. * When a disk does become full, RCOPY will pause to allow inserting a new disk. * Pressing any other key will pause processing. * Unless overridden, a "Y/N" prompt will be issued before a new directory is created. ═══ 1.1. Processing Options ═══ RCOPY provides several optional command parameters to customize a process. SYNTAX: RCOPY from_spec [to_specs] [options] All options must be prefixed with a "/" [from] Enter the from_spec just like you would for the OS/2 Copy command, including wildcard characters. Unlike the OS/2 Copy, RCOPY allows entering multiple from specs, each separated by a "+" or comma. Example: RCOPY *.EXE+*.COM A:\. Optionally, a file containing a list of the from specs can be used. The list of specifications will be processed as if they were enter on the command line. To use this option, prefix the filename with the character "@". Example: RCOPY @RCOPY.LST A:\ [to] Enter the to_spec just like you would for the OS/2 Copy. If there is no to_spec, the current directory will be used. If the to_spec does not exist, RCOPY will prompt to determine if it is a filename or directory. To avoid this prompt, attach a "\" to a new directory name or "." to a filename. Examples: RCOPY *.* A:\NEWDIR\ RCOPY *.CMD A:\NEWFILE. Frequently used options can be stored in the OS/2 environment variable "RCOPY"; Example: SET RCOPY=/NS to always run RCOPY with "beeps" turned off ═══ 1.1.1. A - Process Updated Files ═══ Processes only files that have been marked updated by OS/2. ═══ 1.1.2. AD - Assume New to_spec is a Directory ═══ Assume the to_spec is a directory if it does not already exist, bypassing the RCOPY "file or directory" prompt. ═══ 1.1.3. AF - Assume New to_spec is a File ═══ Assume the to_spec is a file if it does not already exist, bypassing the RCOPY "file or directory" prompt. ═══ 1.1.4. AFX - Assume New to_spec a Directory if there is no extension ═══ If the to_spec does not exist and there is no extension, a new directory is assumed, bypassing the RCOPY "file or directory" prompt. ═══ 1.1.5. AP - Append to to_spec File ═══ Append all the from_spec files to the end of the to_spec file. Example: RCOPY FILE.A+FILE.B+FILE.C FILE.APP /AP ═══ 1.1.6. AN - Assume New Disk when Current is Full ═══ Assume a New Disk when the current disk becomes full. The Bypass and Split file options will not be available. ═══ 1.1.7. AS - Automatically Split Files ═══ Auto Split files when a disk becomes full and there is enough room to do the requested file processing (bypassing initial "load disk" prompt). ═══ 1.1.8. B - Remove Update Mark on Processed Files ═══ After processing, remove the OS/2 update mark, useful when RCOPY is used for backups. ═══ 1.1.9. BO - Process Files Contained in both the From and To Directory ═══ Process only files that exist in both the from and to directories. ═══ 1.1.10. D: - Select by File Date ═══ Select using the file date. The selection criteria can be a date (YYMMDD), actual number of days or a file name where the system file date will be used. The optional conditions are: ( - File date is older than requested. ) - File date is newer than requested. = - File date is equal to requested (default). Two /D: parameters can be used to select files between two dates. To select all 1993 files, the parameter "/D:)921231/D:(940101" would be used. Files must meet BOTH conditions to be selected. To select files that meet one OR the other condition, include the parameter /DO. When conditions are combined on one statement, the /DO option is assumed. For example, "/D:)=921231" would select all files greater than OR equal to 921231. ═══ 1.1.11. DC - Create Duplicate Directory on to_spec Disk ═══ Create duplicate directory on the to_spec disk for every directory processed on the from_spec disk without prompting. * RCOPY C:\OS2\*.* A:\ /DC would create A:\OS2 * RCOPY C:\OS2\*.* A:\TEMP would create A:\TEMP\OS2 ═══ 1.1.12. DD: - Drop to_specs Directory Tree Levels ═══ Drop the first "?" levels of the to_specs directory tree. RCOPY C:\OS2\SYSTEM D:\ /DC/DD:1 Copy all the files from C:\OS2\SYSTEM to D:\OS2 RCOPY C:\OS2\SYSTEM D:\ /DC/DD:2 Copy all the files from C:\OS2\SYSTEM to D:\ Prefixing the level number with '-' will cause the first '?' levels of the from_specs dirctory to be dropped. Copy all the files from C:\OS2\SYSTEM to D:\SYSTEM ═══ 1.1.13. DEL - Delete Selected Files ═══ The from_spec files will be DELETED instead of copied or moved. For example, to delete all files with an .BAK extension on the C: drive: Example: RCOPY C:\*.BAK /DEL/S ═══ 1.1.14. DF - Delete Files on Target Drive before Processing ═══ Delete all files on the to_spec drive before processing. ═══ 1.1.15. DF2 - Delete Files on Targe Drive of Second Diskette ═══ If multiple output disks are required, delete all files starting with disk #2. Files will be added to the first disk without deleting. ═══ 1.1.16. DO - Invoke "OR" Condition ═══ When two /D:, /T: or /SZ:. parameters are used, invoke the "OR" condition instead of "AND". ═══ 1.1.17. DR: - Repeat Requesed Process on Multiple Drives ═══ Repeat the same process for "?" drives. For example, "/DR:CFG" would process the requested file specs on drives "C", "F" and "G" only. ═══ 1.1.18. ED - Delete Files in to_specs Directories before Processing ═══ Delete all the files in the to_specs directories before processing from_spec files. ═══ 1.1.19. FO - Format Destination Diskettes ═══ Format all output each destination diskette before processing. ═══ 1.1.20. FO2 - Format Second Destination Diskette ═══ If multiple output disks are required, only format starting with disk #2. Files will be added to the first disk without formatting. ═══ 1.1.21. H - Process HIDDEN and SYSTEM Files ═══ Allows processing both HIDDEN and SYSTEM files. ═══ 1.1.22. IP: - Process Only Files Contained in to_specs Directory ═══ Process only files that exists in PATHNAME. To copy all the files on "C" drive to \TEMP only if each file already exists in \OS2\SYSTEM RCOPY C:\*.* \TEMP /IP:\OS2\SYSTEM /S ═══ 1.1.23. IP-: - Skip Files Contained in to_specs Directory ═══ Same as /IP:, except files that DO NOT exists in PATHNAME are processed. ═══ 1.1.24. L - List Select Files Only - No Processing ═══ List files that meet selection criteria - NO processing occurs. ═══ 1.1.25. LG - Log Processing Activities ═══ Processing activities will be appended to the end of the file RCOPY.LOG in the same directory where RCOPY.CMD is stored. To create RCOPY.LOG in a different location, use /LG: or /LG:. Prefixing with "@" will cause RCOPY to create a new log file each time. Prefixing with "!" will create a new LIST file. In this case, the file will only contain a list of the processed files. The file can then be used as input to other programs, including RCOPY (when prefixed with "@"). ═══ 1.1.26. M - Move Selected Files ═══ Move the selected from_spec files to the to_specs location. Default is copy. ═══ 1.1.27. MU - Process Multiple Input Disks ═══ Process multiple input disks. To define how many input diskettes, use /MU:nn. ═══ 1.1.28. N - Process New Files Only ═══ Process only those files that do not already exist on the to_spec directory. ═══ 1.1.29. NC - No COPY or MOVE Action with /PGM option ═══ No COPY or MOVE function performed when /PGM option is used. Only required if a target directory is requested. Useful when using the /BO or /N options to feed selected files to a /PGM function. ═══ 1.1.30. NS - No Sound ═══ Suppress "beeps" issued at various prompts. ═══ 1.1.31. NT- No Totals Display ═══ Do not display totals when processing terminates. ═══ 1.1.32. O - Process Older Files ═══ Process only files that either do not exist in the to_specs directory or are older than those that do exist. ═══ 1.1.33. OD: - Omit Processing Requested Directories ═══ Specify a list of directories that are to be bypassed during processing; Example: RCOPY *.* C:\ /OD:\OS2,\MUGLIB All sub-directories belonging to the requested directory will also be bypassed. A filename listing the directories can also be used by prefixing with "@"; Example: RCOPY *.* C:\ /OD:@DIR.LST To bypass just the first directory of a tree, attach a '\' to the directory name Example: RCOPY *.* C:\ /OD:\OS2\,\MUGLIB ═══ 1.1.34. OF: - Omit Selecting Requested Files ═══ Specify a list of filenames or patterns to be bypassed during processing; Example: RCOPY *.* C:\ /OF:*.BAK,*.ZIP,*.$* A filename listing the specs can also be used by prefixing with "@"; Example: RCOPY *.* C:\ /OF:@FILE.LST ═══ 1.1.35. P - Pause at Each Selected File ═══ Pause before each file is processed. ═══ 1.1.36. PE - Pause at End of Processing ═══ Pause at the end of processing. Useful when executing RCOPY from a window that closes on exit. To control the length of the pause, enter /PEx, where "x" is the number of seconds to pause. ═══ 1.1.37. PGM: - Execute External Program ═══ Execute the command "xxx" against all the selected files. To also do a COPY or MOVE before executing the program, a TO directory must be included. Multiple /PGM: options can be requested. $ Replaced with the full filenames of each selected file. # Replace with filename of each selected file (no path). ] Replaced with '/'. { Replaced with directory of file selected for processing. % Replaced with drive of file selected for processing ) Replaced with '>' ( Replaced with '<' ! Replaced with '|' The following example shows how to print then zip every file on the C: drive with a ".DOC" extension. RCOPY C:\*.DOC /S/PGM:PRINT/PGM:PKZIP2 -U ZIPFILE $ )NUL If a command is prefixed with "-", the commands will be written to PGM.CMD instead of being executed. RCOPY C:\*.DOC /S/PGM:-PRINT/PGM:PKZIP2 -U ZIPFILE $ )NUL RCOPY defaults to passing ALL the selected files to the "/PGM:" program. To limit the number of files passed use the option "/PGMn:", where "n" is the number of files to pass. For example, to pass 30 selected files to PKZIP2 and one to PRINT per execution: RCOPY C:\*.DOC /S/PGM:PRINT/PGM30:PKZIP2 -U ZIPFILE $ )NUL ═══ 1.1.38. R - Replace Duplicate File Names in Target Directory ═══ Replace duplicate files without prompting. ═══ 1.1.39. RD - Reset Date of Processed Files ═══ Reset date of processed files to current date. ═══ 1.1.40. RE - Remove Empty Directories ═══ Remove empty directories after MOVE process. ═══ 1.1.41. RO - Process Read-Only Files ═══ Allow MOVING, REPLACING or DELETING Read-Only Files. Copying Read-Only files will always work. ═══ 1.1.42. S - Process Sub-Directories ═══ Process all from_spec sub-directories. ═══ 1.1.43. SA - Save Duplicate Target Files ═══ Instead of replacing a file, rename it by changing the last to positions of the file's extension to "01" to "99". ═══ 1.1.44. SD - Short Display ═══ The progress display shows only the files processed and the final totals. ═══ 1.1.45. SD2 - Shorter Display ═══ The progress display shows only the files processed. ═══ 1.1.46. SE - Skip Duplicates ═══ Skip files that are EXACT duplicates. ═══ 1.1.47. SF: - Split Files ═══ Splits the selected files into sub-files of "nnn" kilobytes (kbyte=1024 bytes). The sub-files are named filename.001, filname.002, etc and will be stored in the copy-to directory. ═══ 1.1.48. ST: - Reserve Space on Target Drive ═══ Reserve "?" amount of freespace on the to_specs drive. Once the minimum is reached, RCOPY will issue the load-next-disk prompt. ═══ 1.1.49. SZ: - Select by File Size ═══ Select a file based on its size. Same rules as /D:. ═══ 1.1.50. T - Test mode ═══ Test mode. No actual processing takes place, but normal processing messages are still issued ═══ 1.1.51. T: - Select by File Time ═══ Select a file based on its file time. Same rules as /D: ═══ 1.1.52. U - Process Newer Files ═══ Process only files that either do not exist in the to_specs directory or are newer than those that do exist. ═══ 1.1.53. US - Unsplit Split Files ═══ Unsplits, or joins, the multiple files created using the /SF: option. For example, "RCOPY MYFILE.ZIP /US" will join the files MYFILE.001, MYFILE.002, ... into the file MYFILE.ZIP. The join file will be stored in the copy-to directory. If the split files are stored on multiple diskettes, use the /MU option (diskettes must be processed in correct sequence). ═══ 1.1.54. V - Verify Process ═══ Verify a process using the OS/2 verify option. ═══ 1.1.55. WA - Pause for Diskette ═══ Pause RCOPY's initial processing and prompt for a diskette. ═══ 1.1.56. WY - Why not Selected ═══ Display the files that were skipped and tell why. ═══ 1.2. Usage Examples ═══ 1) Move all the files on the A: drive to the appropriate sub-directories on the C: drive, replacing files that already exists and removing the directories from A:. call RCOPY 'A:\*.* C:\ /S/DC/M/RE' 2) Copy all the files on the C: drive to the appropriate sub-directories on the A: drive that were updated today, bypassing directories listed in the file RCOPY.OD and bypassing the filespecs in the file RCOPY.OF. call RCOPY 'C:\*.* A:\ /S/DC/V/OD:@C:\RCOPY.OD/OF:@C:\RCOPY.OF/D:)1' 3) The following is an example of multiple RCOPY runs, with each execution using the statistics from the previous run (10,000 bytes is reserved for the file INSTALL.CMD). /* */ parse value RCOPY('*.ZIP+*.CMD A:\ /AN/SD2/NT/DF/ST:10000) with retcd copied nbrdisks processed bytes . if retcd<>0 then EXIT ..... Code to create INSTALL.CMD ..... if nbrdisks>1 then do say 'Please Re-Insert Disk #1' pause end call RCOPY 'INSTALL.CMD A:\ /SD/V/#FC:'||copied||'/#FP:'||processed|| '/#ND:1/#BC:'||bytes ═══ 1.3. RCOPY Return Codes ═══ RCOPY returns five values. 1) Return code "0" if process completed successfully or "1" if not 2) Number of files copied/moved/deleted, depending on option used. If the /SF: option is used, this will be the number of split files created. If the /US options is used, this will be the number of joined files created. 3) Number of input disks processed 4) Number of files processed, including those skipped or bypassed 5) Number of bytes copied/moved/deleted The syntax to capture these values: parse value RCOPY(specs) with ret_cd copied nbr_disks processed bytes . The following parameters are available for passing the values in 2-5 from one execution of RCOPY to another. /#ND:n - Number Disks /#FC:n - Files copied /#FP:n - Files processed /#BC:n - Bytes copied When these values are passed to RCOPY, they are included in final totals (useful when command file does multiple RCOPYs with different options).